/**
 * $Id: Organization.java 6 2011-09-14 00:18:07Z adriftrock@gmail.com $
 */

package com.swehr.server.models;

import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;

/**
 * @author Rock Huang
 * @version 0.1
 */
@XmlRootElement
public class Organization {
    private String comment;
    private String password;
    private String phoneNumber;
    private String email;
    private String employer;
    private String parent;
    private String orgType;
    private String name;
    private String founder;
    private Date createdTime;
    private Date modifiedTime;
    private String website;
    private String country;
    private String city;
    private Date foundingDate;
    private int order;
    private int id;

    public Organization() {}

    public Organization(int id, int order, Date modifiedTime, Date createdTime,
                        String founder, String name, String employer,
                         String email, String parent, String phoneNumber,
                         String password, String orgType) {
        this.password = password;
        this.phoneNumber = phoneNumber;
        this.email = email;
        this.employer = employer;
        this.parent = parent;
        this.orgType = orgType;
        this.name = name;
        this.founder = founder;
        this.createdTime = createdTime;
        this.modifiedTime = modifiedTime;
        this.order = order;
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFounder() {
        return founder;
    }

    public void setFounder(String founder) {
        this.founder = founder;
    }

    public Date getCreatedTime() {
        return createdTime == null ? new Date() : createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getModifiedTime() {
        return modifiedTime == null ? new Date(0) : modifiedTime;
    }

    public void setModifiedTime(Date modifiedTime) {
        this.modifiedTime = modifiedTime;
    }

    public String getEmployer() {
        return employer;
    }

    public void setEmployer(String employer) {
        this.employer = employer;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getOrgType() {
        return orgType;
    }

    public void setOrgType(String orgType) {
        this.orgType = orgType;
    }

    public String getParent() {
        return parent;
    }

    public void setParent(String parent) {
        this.parent = parent;
    }

    public String getWebsite() {
        return website;
    }

    public void setWebsite(String website) {
        this.website = website;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public Date getFoundingDate() {
        return foundingDate;
    }

    public void setFoundingDate(Date foundingDate) {
        this.foundingDate = foundingDate;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer();
        sb.append("{ \"id\":\"").append(id).append("\"");
        sb.append(", \"website\":\"").append(website).append("\"");
        sb.append(", \"name\":\"").append(name).append("\"");
        sb.append(", \"country\":\"").append(country).append("\"");
        sb.append(", \"city\":\"").append(city).append("\"");
        sb.append(", \"founder\":\"").append(founder).append("\"");
        sb.append(", \"foundingDate\":\"").append(foundingDate).append("\"");
        sb.append(", \"createdTime\":\"").append(createdTime).append("\"");
        sb.append(", \"modifiedTime\":\"").append(modifiedTime).append("\"");
        sb.append(", \"order\":").append(order);
        sb.append(", \"employer\":\"").append(employer).append("\"");
        sb.append(", \"parent\":\"").append(parent).append("\"");
        sb.append(", \"orgType\":\"").append(orgType).append("\"");
        sb.append(", \"email\":\"").append(email).append("\"");
        sb.append(", \"phoneNumber\":\"").append(phoneNumber).append("\"");
        sb.append(", \"comment\":\"").append(comment).append("\"");
        sb.append("}");
        return sb.toString();
    }
}
